import Vue from 'vue'
import {
  Button,
  Form,
  FormItem,
  Input,
  DatePicker,
  TimePicker,
  Message,
  Container,
  Header,
  Aside,
  Main,
  Menu,
  Submenu,
  MenuItem,
  Breadcrumb,
  BreadcrumbItem,
  Card,
  Row,
  Col,
  Table,
  TableColumn,
  Switch,
  Tooltip,
  Pagination,
  Dialog,
  MessageBox,
  Tag,
  Tree,
  Select,
  Option,
  OptionGroup,
  Cascader,
  Alert,
  Tabs,
  TabPane,
  Steps,
  Step,
  CheckboxGroup,
  Checkbox,
  Upload,
  Timeline,
  TimelineItem,
  Rate,
  Radio,
  RadioGroup,
  Loading,
  InputNumber,
  Descriptions,
  DescriptionsItem,
  ColorPicker,
  Link,
  Popconfirm,
  Popover,
  Image,
  TimeSelect
} from 'element-ui'

Vue.use(Descriptions);
Vue.use(DescriptionsItem);
Vue.use(InputNumber);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(DatePicker);
Vue.use(TimePicker);
Vue.use(Loading)
Vue.use(Button)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Row)
Vue.use(Col)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Select)
Vue.use(Option)
Vue.use(OptionGroup)
Vue.use(Cascader)
Vue.use(Alert)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Steps)
Vue.use(Step)
Vue.use(CheckboxGroup)
Vue.use(Checkbox)
Vue.use(Upload)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Rate)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Descriptions)
Vue.use(DescriptionsItem)
Vue.use(ColorPicker)
Vue.use(Link)
Vue.use(Popconfirm)
Vue.use(Popover)
Vue.use(Image)
Vue.use(TimeSelect)

// 需要全局挂载  弹窗
Vue.prototype.$message = Message
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm

// 原本就有的信息提示
Vue.prototype.$message = function (option){
  option.offset = 100
  return Message(option)
}
// 成功提示
Vue.prototype.$message.success = function (msg) {
  return Message.success({
      message: msg,
      offset: 100
  })
}
// 警告提示
Vue.prototype.$message.warning = function (msg) {
  return Message.warning({
      message: msg,
      offset: 100
  })
}
// 错误提示
Vue.prototype.$message.error = function (msg) {
  return Message.error({
      message: msg,
      offset: 100
  })
}

